import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '标题',
    dataIndex: 'title',
    width: 120,
  },
  {
    title: '交易类型',
    dataIndex: 'logType',
    width: 120,
    dictData: [
      { label: '充值', value: 1 },
      { label: '消费', value: 2 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '交易金额',
    dataIndex: 'amount',
    width: 120,
  },
  {
    title: '交易日期',
    dataIndex: 'createTime',
    width: 120,
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '主键',
    field: 'balanceLogId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: 'balanceId',
    field: 'balanceId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: 'userId',
    field: 'userId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '充值额度',
    field: 'amount',
    component: 'InputNumber',
    required: true,
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
];
